def my_print():
    print(1)
    print(1)
    print(4)
    print(1)
    print(1)
    print(41)
    print(1)
    print(5)
    print(1)
    print(14)
    print(1)
    print(1)
    print(14)
    print(1)
    print(15)

# 函数的定义:
def function():
    print("这是函数体")

# 函数的参数:
# 一个参数
# def add(a):
#     print(a)

# add("你好")

# 多个参数
def my_print1(a,b,c,d):
    print(a,b,c,d)

# my_print1("a","ss","dd","casdf")

# 不定长参数
def my_print2(*args):
    print(*args,type(args))

# my_print2(1,2,3,4,5,6,7,8,9,0)

def my_print3(**kwargs):
    print(kwargs,type(kwargs))
    print(kwargs.keys())
#
# my_print3(a=1,b=2,c=3)

# 缺省参数(默认参数)
def print4(a,b,c=4):
    """
    这个函数的具体内容
    :param a:a参数是什么东西
    :param b:
    :param c:
    :return:返回了一个什么
    """
    print(a,b,c)

# print4(1,2)

# def add(a,b):
#     return a+b
# num = add(1,3)
# print(num)
# print(add(1,3))
# help(print4(1,2,3))

import functools
# ok = functools.partial(print4,1,2)
# ok()


# (lambda 参数1,参数2: 要执行的东西)()
# print((lambda a,b : a+b)(1,2))


# 闭包
# def fun1():
#     i = 1
#     def fun2():
#         print(i)
#     return fun2
#
# c = fun1()
# c()



